package com.qfedu.provider.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 点赞
 * @TableName db_like
 */
@TableName(value ="db_like")
@Data
public class DbLike implements Serializable {
    /**
     * 点赞id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 作品id
     */
    private Integer productionId;

    /**
     * 点赞状态
     * 0 ：取消点赞
     * 1 ：点赞
     */
    private Integer status;

    /**
     * 作品类型id
     */
    private Integer productionTypeId;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public DbLike(Integer userId, Integer productionId, Integer productionTypeId) {
        this.userId = userId;
        this.productionId = productionId;
        this.status = 1;
        this.productionTypeId = productionTypeId;
        this.createTime = new Date();
        this.updateTime = new Date();
    }
}